#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int countSegments(char* s)
{
    int count = 0;
    if (*s != '\0' && *s != ' ')
    {
        count++;
    }
    while (*s)
    {
        if (*s == ' ')
        {
            while (*s == ' ')
            {
                s++;
                if (*s == '\0')
                {
                    return count;
                }
            }
            count++;
        }
        s++;
    }
    return count;
}
int main()
{
    char s[] = "                 ";
    printf("%d\n", countSegments(s));
    return 0;
}